Skip to content

Conversation

@mandesero
Copy link
Contributor

Fix a bug when server initialization didn't reset artifact handling, which caused stale artifacts to persist after server restarts.

Closes #409


local prefix = fio.pathjoin(Server.vardir, 'artifacts', self.rs_id or '')
self.artifacts = fio.pathjoin(prefix, self.id)
if fio.path.exists(self.artifacts) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have to delete the artifacts on restart? Artifacts should be saved only when the server is dropped, no?

Also, the comment to server:stop() seems outdated - it says that artifacts are saved only on test failures but it looks like they are saved unconditionally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifacts should be saved only when the server is dropped, no?

Yes, I think you're right. Fixed.

@locker locker assigned mandesero and unassigned locker Dec 3, 2025
@mandesero mandesero force-pushed the mandesero/gh-409-server-artifacts branch from ac276a5 to a299af1 Compare December 3, 2025 12:25
@mandesero mandesero requested a review from locker December 3, 2025 12:27
@mandesero mandesero assigned locker and unassigned mandesero Dec 3, 2025
@locker locker assigned mandesero and unassigned locker Dec 3, 2025
@mandesero mandesero force-pushed the mandesero/gh-409-server-artifacts branch from a299af1 to 18ceda0 Compare December 4, 2025 09:17
@mandesero mandesero requested a review from locker December 4, 2025 09:34
@mandesero mandesero assigned locker and unassigned mandesero Dec 4, 2025
@locker locker assigned mandesero and unassigned locker Dec 4, 2025
@mandesero mandesero force-pushed the mandesero/gh-409-server-artifacts branch 2 times, most recently from 48f2121 to 342acf7 Compare December 5, 2025 10:57
Fix a bug when server initialization didn't reset artifact handling,
which caused stale artifacts to persist after server restarts.

Closes tarantool#409
@mandesero mandesero force-pushed the mandesero/gh-409-server-artifacts branch from 342acf7 to 29e8538 Compare December 5, 2025 10:59
@mandesero mandesero requested a review from locker December 5, 2025 11:10
@mandesero mandesero assigned locker and unassigned mandesero Dec 5, 2025

if (node.had_failure or not node:is('success')) and utils.table_len(node.servers) > 0 then
for _, server in pairs(node.servers) do
server:save_artifacts()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU this is invoked after running after_test and after_each hooks. Is it possible to save artifacts before running the hooks? The point is that the hooks may do some cleanup, for example, drop test spaces, etc, while we'd usually like to see what was the actual server state at the moment of failure.

assert_artifacts_path(g.s_all)
assert_artifacts_path(g.s_all2)
ctx.runner:update_status(test, {status = 'fail'})
test:update_status('success')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests look weird. Why do we need to change the status manually? Can't we fail an assertion or raise an error to check if artifacts are saved on failure?

@locker locker assigned mandesero and unassigned locker Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server artifacts are not saved after restart

2 participants